<template>
  <div class="sub-header">
    <a class="Create-questionnaire" href="">
      <img class="plus-sign" src="../../assets/24.svg" alt="" />创建问卷
    </a>
    <div class="function">
      <botton @click="$emit('create')" title="创建文件夹" class="folder"></botton>
      <a title="废纸篓" class="trash" href=""></a>
      <botton
        v-if="isGridView"
        @click="isGridView = false"
        title="网格视图"
        class="grid-view"
      ></botton>
      <botton v-else @click="isGridView = true" title="列表视图" class="list-view"></botton>
    </div>

  </div>
</template>

<script>
export default {
  data() {
    return {
      isGridView: false,
    };
  },
};
</script>

<style lang="scss" scoped>
.sub-header {
  min-width: 980px;
  box-shadow: 0px 3px 8px 0px rgba(224, 229, 236, 0.4);
  background-color: #fff;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0px 3px 8px 0px rgba(224, 229, 236, 0.4);
  position: fixed;
  top: 60px;
  bottom: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid #e1e7f2;
}

.Create-questionnaire {
  display: inline-flex;
  background-color: #008fff;
  border-color: #008fff;
  color: #fff;
  border-radius: 4px;
  width: 105px;
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.Create-questionnaire:hover {
  background-color: #2196f3;
}

.plus-sign {
  width: 13px;
  height: 13px;
  margin-right: 4px;
}

.function {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.folder {
  width: 21px;
  height: 21px;
  margin-right: 40px;
  text-align: center;
  background-image: url("../../assets/25.svg");
  background-size: 21px 21px;
  cursor: pointer;
}

.folder:hover {
  background-image: url("../../assets/25 copy.svg");
}

.trash {
  background-image: url("../../assets/26.png");
  height: 21px;
  width: 21px;
  background-repeat: no-repeat;
  background-size: 21px 21px;
  margin-right: 20px;
}

.trash:hover {
  background-image: url("../../assets/亮了的垃圾桶.png");
}

.list-view {
  background-image: url("../../assets/27.svg");
  width: 20px;
  height: 20px;
  margin-left: 21px;
  background-size: 21px 21px;
  cursor: pointer;
}

.grid-view {
  background-image: url("../../assets/网格.svg");
  width: 20px;
  height: 20px;
  margin-left: 21px;
  background-size: 21px 21px;
  cursor: pointer;
  display: inline-block;
}

.grid-view:hover {
  background-image: url("../../assets/网格 copy.svg");
}

.list-view:hover {
  background-image: url("../../assets/27 copy.svg");
}
</style>
